Skip to content

Conversation

darktohka
Copy link
Contributor

@darktohka darktohka commented Nov 28, 2024

Building crun after commit 8a0ee4b yields the following link error:

2024-11-28T01:45:15.2415817Z   CCLD     libcrun.la
2024-11-28T01:45:15.3802217Z   CCLD     crun
2024-11-28T01:45:15.4957602Z /home/runner/work/zebrafish/zebrafish/buildroot/output/host/lib/gcc/x86_64-buildroot-linux-gnu/13.3.0/../../../../x86_64-buildroot-linux-gnu/bin/ld: src/libcrun/crun-cloned_binary.o: in function `ensure_cloned_binary':
2024-11-28T01:45:15.4959563Z cloned_binary.c:(.text+0x87c): undefined reference to `get_bind_mount'
2024-11-28T01:45:15.4961482Z /home/runner/work/zebrafish/zebrafish/buildroot/output/host/lib/gcc/x86_64-buildroot-linux-gnu/13.3.0/../../../../x86_64-buildroot-linux-gnu/bin/ld: cloned_binary.c:(.text+0x8b7): undefined reference to `crun_error_release'
2024-11-28T01:45:15.4973731Z collect2: error: ld returned 1 exit status
2024-11-28T01:45:15.4989126Z make[3]: *** [Makefile:1547: crun] Error 1

This is because 8a0ee4b adds an include to "linux.h" (which has get_bind_mount and a transitive include to "error.h" which has crun_error_release). The Makefile for crun the binary builds src/libcrun/cloned_binary.c... which is already built as part of libcrun the library which is linked directly to crun.

Therefore it's enough to remove the src/libcrun/cloned_binary.c file from crun sources, it is already included through the link step.

An alternative would be to add src/libcrun/error.c, src/libcrun/utils.c, src/libcrun/linux.c to the crun sources, but that would be too much unnecessary bloat.

Signed-off-by: Derzsi Dániel <daniel@tohka.us>
@darktohka darktohka force-pushed the bugfix/crun-build-makefile branch from 783426a to 5d66b30 Compare November 28, 2024 10:46
Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giuseppe giuseppe merged commit 38c717f into containers:main Dec 6, 2024
51 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants